clear all

foreach data in $datafilesfirm {

	* Set globals:
		global dataspec `data'
		global n = 2
		global rhs1 diff_ln_IND 
		global rhs2 diff_wIPT_IND_CHN
		global ivs1 diff_ln_IVS 
		global ivs2 diff_wIPT_LMI_CHN_EXCL_IND
		global ctrl 
	do "$code/estimation/flexible/firm_regs.do"

	* Set globals:
		global dataspec `data'
		global n = 3
		global rhs1 diff_ln_IND 
		global rhs2 
		global ivs1 diff_ln_IVS 
		global ivs2 
		global ctrl diff_wIPT_LMI_CHN_EXCL_IND
	do "$code/estimation/flexible/firm_regs.do"

	use "$tempfold/bs2_`data'", clear
	merge 1:1 bs using "$tempfold/bs3_`data'", nogen
	save "$BS_fold/bs_`data'", replace

}
